package com.itheima.search.feign;

import com.itheima.Result;
import com.itheima.question.pojo.Question;
import com.itheima.question.pojo.QuestionItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("mmquestion")
public interface QuestionFeignApi {
    @PutMapping("/question/edit")
    public Result editQuestion(@RequestBody Question question);

    @GetMapping("/question/{id}")
    public Question queryById(@PathVariable("id") String id);

    @GetMapping("/question/item/{id}")
    public List<QuestionItem> queryItemById(@PathVariable("id") String id);

}
